/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
Ext.onReady(function(){
    Ext.QuickTips.init();
    var mytree=new Ext.tree.TreePanel({
        el:"container",
        animate:true,
        title:"管理员操作",
        collapsible:true,
        enableDD:true,
        enableDrag:true,
        rootVisible:true,
        autoScroll:true,
        autoHeight:true,
        width:180,
        lines:true
    });

    //根节点
    var root=new Ext.tree.TreeNode({
        id:"root",
        text:"控制面板",
        expanded:true
    });

    //第一个子节点及其子节点
    var sub1=new Ext.tree.TreeNode({
        id:"appAdmin",
        text:"应用程序管理",
        singleClickExpand:true
    });
    sub1.appendChild(new Ext.tree.TreeNode({
        id:"appList",
        text:"应用列表",
        href:"http://www.baidu.com",
        hrefTarget:"mainFrame",
        qtip:"查看应用列表"
    }));
    sub1.appendChild(new Ext.tree.TreeNode({
        id:"addApp",
        text:"添加应用",
        hrefTarget:"mainFrame",
        qtip:"添加一个应用"
    }));

    var sub2=new Ext.tree.TreeNode({
        id:"jobAdmin",
        text:"作业管理",
        singleClickExpand:true
    });
    sub2.appendChild(new Ext.tree.TreeNode({
        id:"jobList",
        text:"作业列表",
        href:"http://www.baidu.com",
        hrefTarget:"mainFrame",
        qtip:"查看应用列表"
    }));

    var sub3=new Ext.tree.TreeNode({
        id:"userAdmin",
        text:"用户管理",
        singleClickExpand:true
    });
    sub3.appendChild(new Ext.tree.TreeNode({
        id:"userList",
        text:"用户列表",
        href:"http://www.baidu.com",
        hrefTarget:"mainFrame",
        qtip:"查看用户列表"
    }));
    sub3.appendChild(new Ext.tree.TreeNode({
        id:"addUser",
        text:"审核新增用户",
        href:"http://www.baidu.com",
        hrefTarget:"mainFrame",
        qtip:"审核一个新注册的用户"
    }));


    root.appendChild(sub1);

    root.appendChild(sub2);
    root.appendChild(sub3);


    root.appendChild(new Ext.tree.TreeNode({
        id:"sys",
        text:"系统设置"
    }));

    mytree.setRootNode(root);//设置根节点

    mytree.render();//不要忘记render()下,不然不显示哦
})

